﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Cinemax.DTO;
namespace Cinemax.DAO
{
    public class KhuyenMaiDAO
    {
        static rapphimDataContext data = new rapphimDataContext();

        public static List<KhuyenMaiDTO> getAllPromotion()
        {
            List<KhuyenMaiDTO> dskm = new List<KhuyenMaiDTO>();
            List<SP_GET_KHUYENMAIResult> dskmps = new List<SP_GET_KHUYENMAIResult>();
            dskmps = data.SP_GET_KHUYENMAI().ToList();
            foreach (SP_GET_KHUYENMAIResult item in dskmps)
            {
                KhuyenMaiDTO km = new KhuyenMaiDTO(item);
                dskm.Add(km);
            }
            return dskm;
        }

        public static void updatepromotion(int id, int tlg)
        {
            data.SP_UPDATE_KHUYENMAI(id, tlg);
        }
    }
}